Skip to content

Conversation

erikhfj
Copy link
Member

@erikhfj erikhfj commented Nov 20, 2026

Closes #103

What was done

  • Moved the search history error message and Retry recent searches button inside the RecentSearches dropdown panel (client/src/components/RecentSearches.tsx and RecentSearches.css), rendering them only while the dropdown is open so closed-state errors no longer float over or overlap page content.
  • Updated useSearchHistory.ts so retry() returns Promise<boolean> indicating whether refetch() succeeded, and added retryHistory() in SearchForm.tsx to return keyboard focus to the search input when a retry succeeds and removes the Retry button (without stealing focus if the user moved elsewhere or if retry fails).
  • Updated RecentSearches.test.tsx and searchHistory.test.tsx to cover closed/open error visibility, Escape dismissal, and keyboard focus restoration on retry, and logged the change in docs/AI-USAGE.md.

What was tested

  • pnpm format:check && pnpm lint && pnpm typecheck && pnpm test && pnpm build — all passed.
    • Client: 20 test files / 205 tests passed (including new closed/open error visibility and keyboard retry focus tests).
    • Largest client JS chunk: 385.84 kB (under 512 kB budget).

@erikhfj erikhfj requested a review from a team as a code owner November 20, 2026 20:15
robertky
robertky previously approved these changes Nov 20, 2026
Copy link
Member

@robertky robertky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. The history error and retry action now live inside the open dropdown, so a closed dropdown cannot obscure page content. Retry reports whether the refresh succeeded, and focus returns to the search input only when the retry button disappears and focus has not moved elsewhere. The new tests cover visibility, retry and focus behavior; CI passes.

@erikhfj erikhfj force-pushed the fix/103-search-history-error-visibility branch from f6a254f to 83ad86f Compare November 20, 2026 20:36
Copy link
Member

@robertky robertky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. The error and retry action are now shown only inside the open search-history dropdown, and the retry handler restores focus to the search input after a successful refresh when the user has not moved focus. The added tests cover the closed/open states, retry behavior, and focus restoration. Format, lint, typecheck, unit tests, build, and PostgreSQL integration checks pass.

@robertky robertky merged commit 85e51c8 into main Nov 20, 2026
3 checks passed
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix search history error appearing when dropdown is closed
2 participants